/*
package com.eshop.config;

import com.google.common.base.Predicates;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;
import java.util.List;

@Configuration(proxyBeanMethods = false)
@EnableSwagger2
public class SwaggerConfig
{
    @Value("${jwt.header}")
    private String tokenHeader;
    @Value("${jwt.token-start-with}")
    private String tokenStartWith;
    @Value("${swagger.enabled}")
    private Boolean enabled;
    @Value("${swagger.title}")
    private String title;
    @Value("${swagger.version}")
    private String version;
    @Value("${swagger.serverUrl}")
    private String serverUrl;
    
    @Bean
    public Docket createRestApi() {
        ParameterBuilder ticketPar = new ParameterBuilder();
        List<Parameter> pars = new ArrayList<Parameter>();
        ticketPar.name(this.tokenHeader).description("token")
                .modelRef(new ModelRef("string"))
                .parameterType("header")
                .defaultValue(this.tokenStartWith + " ")
                .required(true).build();
        pars.add(ticketPar.build());
        return new Docket(DocumentationType.SWAGGER_2)
                .enable((boolean)this.enabled)
                .apiInfo(this.apiInfo()).select()
//                .apis(RequestHandlerSelectors.basePackage("com.eshop.modules"))
                .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
                .paths(Predicates.not(PathSelectors.regex("/error.*")))
                .build().globalOperationParameters((List)pars);
    }
    
    private ApiInfo apiInfo() {
        return new ApiInfoBuilder().title(this.title)
                .termsOfServiceUrl(this.serverUrl)
                .description(this.title)
                .version(this.version)
                .contact(new Contact("hupeng", "https://www.yixiang.co", "guchengwuyue@163.com"))
                .build();
    }
}
*/
